package treqs.model;

// Generated 2009-aug-16 19:26:12 by Hibernate Tools 3.2.4.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Task generated by hbm2java
 */
@Entity
@Table(name = "task", catalog = "treqs")
public class Task implements java.io.Serializable {

	private Integer id;
	private Taskpriority taskpriorityByEffortUnitId;
	private Taskeffortunit taskeffortunit;
	private Taskpriority taskpriorityByStatusId;
	private String name;
	private String description;
	private int estimatedEffort;
	private int priorityId;
	private Date creationDate;
	private Date deletionDate;
	private Date editDate;
	private byte[] editLog;
	private Set<Tasktorequirement> tasktorequirements = new HashSet<Tasktorequirement>(
			0);

	public Task() {
	}

	public Task(Taskpriority taskpriorityByEffortUnitId,
			Taskeffortunit taskeffortunit, Taskpriority taskpriorityByStatusId,
			String name, int estimatedEffort, int priorityId, Date creationDate) {
		this.taskpriorityByEffortUnitId = taskpriorityByEffortUnitId;
		this.taskeffortunit = taskeffortunit;
		this.taskpriorityByStatusId = taskpriorityByStatusId;
		this.name = name;
		this.estimatedEffort = estimatedEffort;
		this.priorityId = priorityId;
		this.creationDate = creationDate;
	}

	public Task(Taskpriority taskpriorityByEffortUnitId,
			Taskeffortunit taskeffortunit, Taskpriority taskpriorityByStatusId,
			String name, String description, int estimatedEffort,
			int priorityId, Date creationDate, Date deletionDate,
			Date editDate, byte[] editLog,
			Set<Tasktorequirement> tasktorequirements) {
		this.taskpriorityByEffortUnitId = taskpriorityByEffortUnitId;
		this.taskeffortunit = taskeffortunit;
		this.taskpriorityByStatusId = taskpriorityByStatusId;
		this.name = name;
		this.description = description;
		this.estimatedEffort = estimatedEffort;
		this.priorityId = priorityId;
		this.creationDate = creationDate;
		this.deletionDate = deletionDate;
		this.editDate = editDate;
		this.editLog = editLog;
		this.tasktorequirements = tasktorequirements;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "effortUnitID", nullable = false)
	public Taskpriority getTaskpriorityByEffortUnitId() {
		return this.taskpriorityByEffortUnitId;
	}

	public void setTaskpriorityByEffortUnitId(
			Taskpriority taskpriorityByEffortUnitId) {
		this.taskpriorityByEffortUnitId = taskpriorityByEffortUnitId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "effortUnitID", nullable = false, insertable = false, updatable = false)
	public Taskeffortunit getTaskeffortunit() {
		return this.taskeffortunit;
	}

	public void setTaskeffortunit(Taskeffortunit taskeffortunit) {
		this.taskeffortunit = taskeffortunit;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "statusID", nullable = false)
	public Taskpriority getTaskpriorityByStatusId() {
		return this.taskpriorityByStatusId;
	}

	public void setTaskpriorityByStatusId(Taskpriority taskpriorityByStatusId) {
		this.taskpriorityByStatusId = taskpriorityByStatusId;
	}

	@Column(name = "name", nullable = false, length = 65535)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description", length = 65535)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "estimatedEffort", nullable = false)
	public int getEstimatedEffort() {
		return this.estimatedEffort;
	}

	public void setEstimatedEffort(int estimatedEffort) {
		this.estimatedEffort = estimatedEffort;
	}

	@Column(name = "priorityID", nullable = false)
	public int getPriorityId() {
		return this.priorityId;
	}

	public void setPriorityId(int priorityId) {
		this.priorityId = priorityId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "creationDate", nullable = false, length = 19)
	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "deletionDate", length = 19)
	public Date getDeletionDate() {
		return this.deletionDate;
	}

	public void setDeletionDate(Date deletionDate) {
		this.deletionDate = deletionDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "editDate", length = 19)
	public Date getEditDate() {
		return this.editDate;
	}

	public void setEditDate(Date editDate) {
		this.editDate = editDate;
	}

	@Column(name = "editLog")
	public byte[] getEditLog() {
		return this.editLog;
	}

	public void setEditLog(byte[] editLog) {
		this.editLog = editLog;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "task")
	public Set<Tasktorequirement> getTasktorequirements() {
		return this.tasktorequirements;
	}

	public void setTasktorequirements(Set<Tasktorequirement> tasktorequirements) {
		this.tasktorequirements = tasktorequirements;
	}

}
